home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr25 / me310.zip / UE310CMD.ZIP / NEWPAGE.CMD < prev    next >
OS/2 REXX Batch file  |  1989-03-19  |  2KB  |  97 lines

  1. ;    NEWPAGE.CMD:    Startup page Loader
  2. ;            for MicroEMACS 3.9d and above
  3. ;            (C)opyright 1987 by Daniel M Lawrence
  4.  
  5. ; Get rid of the last page
  6.     set $discmd FALSE
  7.     write-message [Cleaning]
  8.     run clean
  9.  
  10. !force    delete-buffer "[clean]"
  11.  
  12. ; make sure the function key window is up
  13.     set %rcfkeys FALSE
  14.     execute-macro-1
  15.  
  16. !if ¬ $pending
  17.  
  18.     ; Write out the page load instructions
  19.     save-window
  20.     1 next-window
  21.     beginning-of-file
  22.     set $curcol 25
  23.     overwrite-string "           Available Pages to Load:                 "
  24.     next-line
  25.     set $curcol 25
  26.     overwrite-string "    [W]  WORDprocessing       [P]  Pascal           "
  27.     next-line
  28.     set $curcol 25
  29.     overwrite-string "    [E]  EMACS macroes        [C]  C                "
  30.     next-line
  31.     set $curcol 18
  32.     overwrite-string "    "
  33.     set $curcol 25
  34.     overwrite-string "    [B]  BOX/block editing    [O]  Cobol            "
  35.     next-line
  36.     set $curcol 25
  37.     overwrite-string "[space]  to load a user page                        "
  38.     unmark-buffer
  39.     beginning-of-file
  40.     !force restore-window
  41.     update-screen
  42.  
  43.  
  44. ; prompt for the page
  45.  
  46.     write-message "Page to load: "
  47. !endif
  48.  
  49. *prompt
  50.     set %rctmp >key
  51.     clear-message-line
  52.     
  53. ; check for an abort
  54.     !if &seq %rctmp ""
  55.         write-message "[Aborted]"
  56.         save-window
  57.         1 next-window
  58.         beginning-of-file
  59.         set $curcol 25
  60.         overwrite-string "   MicroEMACS:  Text Editor                         "
  61.         next-line
  62.         set $curcol 25
  63.         overwrite-string "                                                    "
  64.         next-line
  65.         set $curcol 25
  66.         overwrite-string "  Available function key Pages include:             "
  67.         next-line
  68.         set $curcol 25
  69.         overwrite-string "    WORD  BOX  EMACS  PASCAL  C                     "
  70.         next-line
  71.         set $curcol 25
  72.         overwrite-string "  [use the f8 key to load Pages]                    "
  73.         unmark-buffer
  74.         beginning-of-file
  75.         !force restore-window
  76.         set $discmd TRUE
  77.         !return
  78.     !endif
  79.     
  80. ; if it is an unlisted page, get it's name
  81.     !if &seq %rctmp " "
  82.         set %rcfile &cat @"Name of Page to load: " ".cmd"
  83.     !else
  84.         set %rcfile &cat %rctmp "page.cmd"
  85.     !endif
  86.  
  87. ; see if this is a legit file
  88.     !if &seq &find %rcfile ""
  89.         write-message "%No Such Page, Page to load: "
  90.         !goto prompt
  91.     !endif
  92.  
  93. ;and lastly, execute it
  94.  
  95.     execute-file %rcfile
  96.     set $discmd TRUE
  97.